<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>Home</title>
		<script src="../../js/lib/jquery-v3.0.0/jquery.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<style type="text/css">
			ul li a {
				font-size: 40px;
			}
		</style>
		<ul>
			<li>
				<div class="link" data-href="#aaa">aaa</div>
			</li>
			<li>
				<div class="link" data-href="#bbb">bbb</div>
			</li>
		</ul>
		<div id="msg1" style="color: red;"></div>
		<div id="msg2" style="color: red;"></div>
		<script type="text/javascript">
			window.onload = function() {
				$(".link").on('click', function(e) {
					$("#msg2").text("click变更事件：" + new Date().getTime());
					location.hash=$(this).data("href");
					$("#msg1").text("new title :"+location.hash);
					document.title = location.hash; //更改标题无效
				});
			}
		</script>
	</body>

</html>